package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhAfterCommissionSettingMapper;
import com.ruoyi.zsyh.domain.ZsyhAfterCommissionSetting;
import com.ruoyi.zsyh.service.IZsyhAfterCommissionSettingService;
import com.ruoyi.common.core.text.Convert;

/**
 * 售后工单提成金额设定Service业务层处理
 * 
 * @author yuexl
 * @date 2022-09-13
 */
@Service
public class ZsyhAfterCommissionSettingServiceImpl implements IZsyhAfterCommissionSettingService 
{
    @Autowired
    private ZsyhAfterCommissionSettingMapper zsyhAfterCommissionSettingMapper;

    /**
     * 查询售后工单提成金额设定
     * 
     * @param id 售后工单提成金额设定ID
     * @return 售后工单提成金额设定
     */
    @Override
    public ZsyhAfterCommissionSetting selectZsyhAfterCommissionSettingById(Long id)
    {
        return zsyhAfterCommissionSettingMapper.selectZsyhAfterCommissionSettingById(id);
    }

    /**
     * 查询售后工单提成金额设定列表
     * 
     * @param zsyhAfterCommissionSetting 售后工单提成金额设定
     * @return 售后工单提成金额设定
     */
    @Override
    public List<ZsyhAfterCommissionSetting> selectZsyhAfterCommissionSettingList(ZsyhAfterCommissionSetting zsyhAfterCommissionSetting)
    {
        return zsyhAfterCommissionSettingMapper.selectZsyhAfterCommissionSettingList(zsyhAfterCommissionSetting);
    }

    /**
     * 新增售后工单提成金额设定
     * 
     * @param zsyhAfterCommissionSetting 售后工单提成金额设定
     * @return 结果
     */
    @Override
    public int insertZsyhAfterCommissionSetting(ZsyhAfterCommissionSetting zsyhAfterCommissionSetting)
    {
        zsyhAfterCommissionSetting.setId(Long.parseLong(IdWorker.getId()));
        zsyhAfterCommissionSetting.setCreateTime(DateUtils.getNowDate());
        return zsyhAfterCommissionSettingMapper.insertZsyhAfterCommissionSetting(zsyhAfterCommissionSetting);
    }

    /**
     * 修改售后工单提成金额设定
     * 
     * @param zsyhAfterCommissionSetting 售后工单提成金额设定
     * @return 结果
     */
    @Override
    public int updateZsyhAfterCommissionSetting(ZsyhAfterCommissionSetting zsyhAfterCommissionSetting)
    {
        zsyhAfterCommissionSetting.setUpdateTime(DateUtils.getNowDate());
        return zsyhAfterCommissionSettingMapper.updateZsyhAfterCommissionSetting(zsyhAfterCommissionSetting);
    }

    /**
     * 删除售后工单提成金额设定对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhAfterCommissionSettingByIds(String ids)
    {
        return zsyhAfterCommissionSettingMapper.deleteZsyhAfterCommissionSettingByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除售后工单提成金额设定信息
     * 
     * @param id 售后工单提成金额设定ID
     * @return 结果
     */
    @Override
    public int deleteZsyhAfterCommissionSettingById(Long id)
    {
        return zsyhAfterCommissionSettingMapper.deleteZsyhAfterCommissionSettingById(id);
    }
}
